package com.ruoyi.recharge.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.recharge.mapper.RechargeDetailMapper;
import com.ruoyi.recharge.domain.RechargeDetail;
import com.ruoyi.recharge.service.IRechargeDetailService;

/**
 * 储值明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-04
 */
@Service
public class RechargeDetailServiceImpl implements IRechargeDetailService 
{
    @Autowired
    private RechargeDetailMapper rechargeDetailMapper;

    /**
     * 查询储值明细
     * 
     * @param id 储值明细主键
     * @return 储值明细
     */
    @Override
    public RechargeDetail selectRechargeDetailById(Long id)
    {
        return rechargeDetailMapper.selectRechargeDetailById(id);
    }

    /**
     * 查询储值明细列表
     * 
     * @param rechargeDetail 储值明细
     * @return 储值明细
     */
    @Override
    public List<RechargeDetail> selectRechargeDetailList(RechargeDetail rechargeDetail)
    {
        return rechargeDetailMapper.selectRechargeDetailList(rechargeDetail);
    }

    /**
     * 新增储值明细
     * 
     * @param rechargeDetail 储值明细
     * @return 结果
     */
    @Override
    public int insertRechargeDetail(RechargeDetail rechargeDetail)
    {
        rechargeDetail.setCreateTime(DateUtils.getNowDate());
        return rechargeDetailMapper.insertRechargeDetail(rechargeDetail);
    }

    /**
     * 修改储值明细
     * 
     * @param rechargeDetail 储值明细
     * @return 结果
     */
    @Override
    public int updateRechargeDetail(RechargeDetail rechargeDetail)
    {
        rechargeDetail.setUpdateTime(DateUtils.getNowDate());
        return rechargeDetailMapper.updateRechargeDetail(rechargeDetail);
    }

    /**
     * 批量删除储值明细
     * 
     * @param ids 需要删除的储值明细主键
     * @return 结果
     */
    @Override
    public int deleteRechargeDetailByIds(Long[] ids)
    {
        return rechargeDetailMapper.deleteRechargeDetailByIds(ids);
    }

    /**
     * 删除储值明细信息
     * 
     * @param id 储值明细主键
     * @return 结果
     */
    @Override
    public int deleteRechargeDetailById(Long id)
    {
        return rechargeDetailMapper.deleteRechargeDetailById(id);
    }
}
